package com.songcan.common.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class LogListener implements ApplicationListener<LogEvent> {


    @Override
    @Async
    @EventListener(LogEvent.class)
    public void onApplicationEvent(LogEvent logEvent) {
        log.info(logEvent.getSource().toString());
    }
}
